<?php 

abstract class Ext_Register_Validate_Abstract implements Ext_Register_Validate_Interface
{
    protected $_messages = array();
    protected $_messager;
    
    public function getMessages()
    {
        return $this->_messages;
    }
    
    public function addMessage($title, $message)
    {
        $translater = Zend_Registry::get('Zend_Translate');
        $title = $translater->translate($title);
        $this->_messages[] = $title.': '.$message;
    }
    
    public function addMessages($title, $messages)
    {
        if(!is_array($messages)){
            $this->addMessage($title, $messages);
            return "";
        }
        
        foreach ($messages as $key=>$message)
        {
            if(is_array($message)){
                $this->addMessages($title, $message);
            }else{
                $this->addMessage($title, $message);
            }
        }
    }
}